Skip to content

Conversation

@roomote
Copy link

@roomote roomote bot commented Oct 30, 2025

This PR attempts to address Issue #8938 where UTF-8 characters in terminal commands were causing encoding errors.

Problem

When running Python commands with special characters like arrows (→), lambda (λ), Chinese characters (中文), or emoji (😀) through Roo Code's terminal, users were encountering encoding errors like:

SyntaxError: Non-UTF-8 code starting with '\\x86' in file <stdin> on line 1

Solution

Added UTF-8 encoding environment variables (LANG and LC_ALL set to en_US.UTF-8) to the VSCode terminal environment configuration. This ensures proper handling of UTF-8 characters in terminal commands, matching the configuration already present in ExecaTerminal.

Changes

  • Added LANG: "en_US.UTF-8" and LC_ALL: "en_US.UTF-8" to Terminal.getEnv() method
  • Created comprehensive tests for UTF-8 environment setup
  • Updated existing TerminalRegistry tests to expect the new environment variables

Testing

  • All existing tests pass
  • New tests verify UTF-8 environment variables are correctly set
  • Tests cover various UTF-8 characters including arrows, lambda, Chinese, and emoji

Fixes #8938

Feedback and guidance are welcome!


Important

Adds UTF-8 encoding environment variables to VSCode terminal to handle special characters.

  • Behavior:
    • Adds LANG: "en_US.UTF-8" and LC_ALL: "en_US.UTF-8" to Terminal.getEnv() in Terminal.ts to handle UTF-8 characters.
    • Ensures UTF-8 encoding for special characters in terminal commands.
  • Testing:
    • Adds tests in Terminal.spec.ts to verify UTF-8 environment variables are set.
    • Updates TerminalRegistry.spec.ts to expect new environment variables.
    • Tests cover various UTF-8 characters including arrows, lambda, Chinese, and emoji.

This description was created by Ellipsis for 3c0b574. You can customize this summary. It will automatically update as commits are pushed.

- Added LANG and LC_ALL environment variables set to en_US.UTF-8
- This ensures proper handling of UTF-8 characters in terminal commands
- Added comprehensive tests for UTF-8 environment setup
- Updated existing tests to expect the new environment variables

Fixes #8938
@roomote roomote bot requested review from cte, jr and mrubens as code owners October 30, 2025 22:03
@dosubot dosubot bot added size:L This PR changes 100-499 lines, ignoring generated files. bug Something isn't working labels Oct 30, 2025
@roomote
Copy link
Author

roomote bot commented Oct 30, 2025

Code Review Summary

No issues found. The changes correctly implement UTF-8 encoding environment variables for the VSCode terminal, matching the approach already used in ExecaTerminal. The implementation is well-tested and should resolve the encoding errors described in issue #8938.

Follow Along on Roo Code Cloud

Copy link
Author

@roomote roomote bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found.

@hannesrudolph hannesrudolph added the Issue/PR - Triage New issue. Needs quick review to confirm validity and assign labels. label Oct 30, 2025
@daniel-lxs
Copy link
Member

Unable to reproduce the issue this PR is trying to fix. After testing UTF-8 commands on macOS with proper locale settings, all commands execute correctly without any encoding issues.

Since the original issue #8938 appears to be environment-specific (VSCodium + Linux + apparmor) and cannot be reproduced on standard configurations, this fix is not needed. Closing this PR.

@daniel-lxs daniel-lxs closed this Oct 30, 2025
@github-project-automation github-project-automation bot moved this from Triage to Done in Roo Code Roadmap Oct 30, 2025
@github-project-automation github-project-automation bot moved this from New to Done in Roo Code Roadmap Oct 30, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working Issue/PR - Triage New issue. Needs quick review to confirm validity and assign labels. size:L This PR changes 100-499 lines, ignoring generated files.

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

[BUG] unicode/charset conversion, terminal command-line

4 participants